doctype html
html(lang="en" ng-app="3drepo").ng-scope
	script(type="text/javascript", src="/public/plugins/base/config.js")
	head
		each issueTypeIssues, issueType in issues
			if issueType === "open" && issueTypeIssues.length > 0
				h2 Open Issues
			else if issueType === "closed" && issueTypeIssues.length > 0
				h2 Closed Issues
			each issue in issueTypeIssues
				table(border=0)
					tr
						td(colspan=2)
							h3 ##{issue.number} #{issue.name}
					if issue.viewpoint.screenshotSmall
						tr
							td(colspan=2) 
								a(href=url(issue.viewpoint.screenshot) target='_blank')
									img(src=url(issue.viewpoint.screenshotSmall))

					tr
						td(colspan=2)
							b Assigned:
							span [#{issue.assigned_roles.join(",")}] 

							b Priority: 
							span #{issue.priority} 

							b Status: 
							span #{issue.status} 

							b Type: 
							span #{issue.topic_type}

					tr
						td(colspan=2)
							b Description: 
							span #{issue.desc}
					tr
						td #{issue.owner} [#{issue.created}]
						td Issue Opened....
					if issue.comments
						each comment in issue.comments
							tr
								td #{comment.owner} [#{comment.created}]
								td 
									if comment.comment
										| #{comment.comment}
									if comment.action
										| #{comment.action.propertyText} changed from 
										i #{comment.action.from} 
										| to 
										i #{comment.action.to}
							if comment.viewpoint && comment.viewpoint.screenshotSmall
								tr
									td(colspan=2)
										a(href=url(comment.viewpoint.screenshot) target='_blank')
											img(src=url(comment.viewpoint.screenshotSmall))
								
				br

